package com.oocl.authority.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;



@Controller
public class AuthorityController {
  
	@ResponseBody
	@RequestMapping("/authority")
	public String authorityControl(HttpServletRequest request){
	   String icnum = (String) request.getSession().getAttribute("icnum");
	   if(icnum!=null){
		   Map<String,Object> users = (Map<String, Object>) request.getServletContext().getAttribute("users");
		   if(users!=null){
			   String status  = (String) users.get(icnum);
			   if("2".equals(status)){
				   return "1";
			   } 
		   }
	   }
		return "0";
	}
	
	
	
	
}
